// To parse this JSON data, do
//
//     final phoneCc = phoneCcFromJson(jsonString);

import 'dart:convert';

import 'package:json_annotation/json_annotation.dart';

part 'phone_cc.g.dart';

PhoneCc phoneCcFromJson(String str) => PhoneCc.fromJson(json.decode(str));

String phoneCcToJson(PhoneCc data) => json.encode(data.toJson());

@JsonSerializable()
class PhoneCc {
  @JsonKey(name: "count")
  int count;
  @JsonKey(name: "list")
  List<CCListElement> list;

  PhoneCc({
    required this.count,
    required this.list,
  });

  factory PhoneCc.fromJson(dynamic json) => _$PhoneCcFromJson(json);

  Map<String, dynamic> toJson() => _$PhoneCcToJson(this);
}

@JsonSerializable()
class CCListElement {
  @JsonKey(name: "calling_code")
  int callingCode;
  @JsonKey(name: "country")
  String country;

  CCListElement({
    required this.callingCode,
    required this.country,
  });

  factory CCListElement.fromJson(Map<String, dynamic> json) =>
      _$CCListElementFromJson(json);

  Map<String, dynamic> toJson() => _$CCListElementToJson(this);
}
